<?=$this->header()?>


    <?=$this->menu("downloads")?>


    <h1><?=$this->message("label.header", _Download::BUNDLE)?></h1>


    <? /* Breadcrums route & user info display */ ?>
    <?=$this->route(
        array(
            array(
                "name"=>$this->message("label.category.header", _Download::BUNDLE),
                "href"=>"download/category/list"
            ),
            array(
                "name"=>$this->category($this->revisions($this->revisionListForm)->getDownload()->getCategoryId()),
                "href"=>"download/list"
            ),
            $this->message("label.revisions", _Download::BUNDLE) . " \"" . $this->truncateNicely($this->revisions($this->revisionListForm)->getDownload()->getDescription(), 16, 26, "...") ."\""
        ),                                                    // Route display
        $this->revisionListForm,                              // ListForm (for user info, see float right)
        $this->revisions($this->revisionListForm)->getRows()) // The total amount of revisions
    ?>


    <? /* Show status messages */ ?>
    <?=$this->messages(_Core::BUNDLE)?>


    <? /* Show error messages */ ?>
    <?=$this->errors(null)?>


    <form id="<?=get_class($this->revisionListForm)?>"
          method="post"
          action="download/revisions">


        <? /* Show the Search & Filter Panel */ ?>
        <?=$this->panel(
            false,                   // Can't add new revisions
            $this->revisionListForm, // ListForm
            array(                   // Filter fields
                DownloadPeer::DESCRIPTION=>$this->message("prompt.description", _Download::BUNDLE),
                BinaryFilePeer::FILE_NAME=>$this->message("label.filename", _Core::BUNDLE),
                DownloadRevisionPeer::REVISION=>$this->message("label.revision", _Download::BUNDLE),
                DownloadRevisionPeer::DESCRIPTION=>$this->message("prompt.message", _Download::BUNDLE),
                DownloadRevisionPeer::INSERT_DATE=>$this->message("choose.created", _Core::BUNDLE),
                DownloadPeer::ACTIVE=>$this->message("choose.active", _Core::BUNDLE),
            ),
            false // No languages for this page.
        )?>


        <? /* Start output buffering in case there are no results */ ?>
        <?$this->start()?>


        <table class="list" cellspacing="0" cellpadding="0">
        <tr>
            <th class="narrow" title="Revision">
                <?=$this->TH(
                    $this->revisionListForm,        // ListForm
                    DownloadRevisionPeer::REVISION, // Sort Field
                    "R"                             // Header Name
                )?>
            </th>
            <th>
                <?=$this->TH(
                    $this->revisionListForm,         // ListForm
                    BinaryFilePeer::FILE_NAME,       // Sort Field
                    $this->message("label.filename", _Core::BUNDLE) // Header Name
                )?>
            </th>
            <th>
                <?=$this->TH(
                    $this->revisionListForm,                     // ListForm
                    DownloadRevisionPeer::DESCRIPTION,           // Sort Field
                    $this->message("prompt.message", _Download::BUNDLE) // Header Name
                )?>
            </th>
            <th class="narrow">
                <?=$this->TH(
                    $this->revisionListForm,           // ListForm
                    DownloadRevisionPeer::INSERT_DATE, // Sort Field
                    $this->message("choose.modified", _Core::BUNDLE)  // Header Name
                )?>
            </th>
        </tr>

        <? foreach($this->revisions($this->revisionListForm)->getItems() as $revision) { ?>

            <? /* Display the default language download */ ?>
            <tr class="ctrl">
                <td  class="checkbox" title="<?=$this->message("label.revision", _Download::BUNDLE)?> <?=$revision->getRevision()?>.">
                    <?=$revision->getRevision()?>
                </td>
                <td>
                    <a title="<?=$this->message("title.download")?>" href="download?id=<?=$revision->getBinaryFileId()?>">
                        <?=$revision->getBinaryFile()->getFileName()?>
                    </a>
                </td>
                <td>
                    <?=nl2br($revision->getDescription())?>
                </td>
                <td class="buttons" title="<?=$this->message("title.modified", _Core::BUNDLE)?> <?=$revision->getInsertDate(_Core::FORMAT_DATETIME)?>">
                    <?=$revision->getInsertDate(_Core::FORMAT_DATE)?>
                </td>
            </tr>

        <? } ?>

        </table>


        <? /* End output buffering */ ?>
        <?$this->end(
            $this->revisionListForm,                             // ListForm
            null,                                                // Can't add new revisions
            $this->revisions($this->revisionListForm)->getRows() // The total amount of users
        )?>


    </form>

<?=$this->footer()?>